<%@ page import="schoolsource.sql.SchoolDBSQL" %>
<%@ page import="schoolsource.gui.FormFields" %>
<%@ page import="schoolsource.model.*" %>
<%@ page import="schoolsource.security.SecurityToken" %>
<% String message = (String) request.getAttribute("displayMessage"); 
   request.setAttribute("displayMessage", null); 
   if (message == null) message = ""; 
   String schoolName = (String) request.getAttribute(FormFields.SCHOOLNAME);
   String loginType = (String) request.getAttribute(FormFields.USRTYPE); 

   SchoolContainer sc = SchoolContainer.getSchoolContainer(schoolName);
   String schoolLogo = sc.getSchoolLogo().toString();
   String schoolLogoWidth = sc.getSchoolLogoWidth().toString();
   String schoolFullName = sc.getSchoolName().toString();
%>
<HTML>
  <HEAD>
      <SCRIPT LANGUAGE="JavaScript">
            function Logon_onload() {
                //window.document.forms[0].elements[3].focus()
                document.loginform.<%= SchoolDBSQL.USRSCHOOLID %>.focus();
            }
      </SCRIPT>
    <TITLE>Administrator Login</TITLE>
  </HEAD>
  <BODY onload=Logon_onload()>
    <FORM NAME="loginform" METHOD="POST">
        <INPUT TYPE="HIDDEN" NAME="<%= FormFields.SCHOOLNAME %>" VALUE="<%= schoolName %>">
        <INPUT TYPE="HIDDEN" NAME="<%= FormFields.USRTYPE %>" VALUE="<%= loginType %>">
        <CENTER>
        <DIV style="font-family:sans-serif;width:365px;height:200px;filter:shadow(color:gray);">
        <TABLE style="border:1px solid black;" bgcolor=#cccccc ALIGN="CENTER" WIDTH="350">

            <TR>
            	<TD COLSPAN="3"><CENTER><B><%= schoolFullName %><BR>Administrator Login</B></CENTER></TD>
            	<TD></TD>
            </TR>

            <TR style="font-size:12;">
	            <TD ROWSPAN="2" ALIGN="CENTER">
	            	<DIV><IMG src="../pics/<%= schoolLogo %>" width='90%'; style=\"border:0;white-space:nowrap;\"></DIV>
            	</TD>
	          	<TD WIDTH="100" ALIGN="RIGHT">Administrator ID: </TD>
	          	<TD ALIGN="LEFT"><INPUT NAME="<%= SchoolDBSQL.USRSCHOOLID %>" TYPE="TEXT" SIZE="20" FOCUS></TD>
	        </TR>
            
	        <TR style="font-size:12;">
	          <TD WIDTH="100" ALIGN="RIGHT">Password: </TD>
	          <TD ALIGN="LEFT" ><INPUT NAME="<%= SchoolDBSQL.USRPASSWORD %>" TYPE="PASSWORD" SIZE="20"></TD>
	        </TR>

	        <TR style="font-size:12;">
	          <TD COLSPAN="3" ALIGN="CENTER"><B><%= message %></B></TD>
	          <TD>&nbsp;</TD>
	        </TR>

	        <TR>
	          <TD COLSPAN="3"ALIGN="CENTER"><INPUT NAME="submitlogin" TYPE="SUBMIT" VALUE="Login"></TD>
    	    </TR>

      </TABLE>
    </FORM>
  </BODY>
</HTML>